public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();

        //内部类由类名直接调用
        BinaryTree.TreeNode root = binaryTree.createTree();

        binaryTree.preOrder(root);
        System.out.println();

        binaryTree.inOrder(root);
        System.out.println();

        binaryTree.postOrder(root);
        System.out.println();

        System.out.println("节点的个数：");
//        binaryTree.getNodeSize(root);
//        System.out.println(binaryTree.nodeSize);
        System.out.println(binaryTree.getNodeSize2(root));

        System.out.println("叶子节点的个数：");
//        binaryTree.getLeafCount(root);
//        System.out.println(binaryTree.leafCount);
        System.out.println(binaryTree.getLeafCount2(root));
    }
}
